package com.music.muisc.services;

import com.music.muisc.dao.InteractionRepository;
import com.music.muisc.entity.Interaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InteractionService {
    @Autowired
    InteractionRepository interactionRepository;
    public List<Interaction> getAll(){
        return interactionRepository.findAll();
    }
    public Interaction save (Interaction interaction){
        return interactionRepository.save(interaction);
    }

    public Interaction findByInteractionId(int theId) {
        return interactionRepository.findByInteractionId(theId);
    }

    public void delete(Interaction theInteraction) {
        interactionRepository.delete(theInteraction);
    }
}
